<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>

<head>
    <title>JSP - Hello World</title>
    <style>
        /* 整体页面的一些基本样式设置 */
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
        }

        /* 表单样式 */
        form {
            background-color: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            width: 400px;
        }

        /* 标题样式 */
        h1 {
            text-align: center;
            color: #333;
            margin-bottom: 20px;
        }

        /* 标签样式 */
        label {
            display: block;
            margin-bottom: 5px;
            color: #555;
        }

        /* 输入框通用样式 */
        input[type="text"],
        input[type="date"] {
            width: 100%;
            padding: 10px;
            margin-bottom: 15px;
            border: 1px solid #ccc;
            border-radius: 4px;
        }

        /* 单选按钮组的样式 */
        .radio-group {
            margin-bottom: 15px;
            display: flex;
            align-items: center;
        }

        .radio-group input[type="radio"] {
            margin-right: 5px;
        }

        /* 提交按钮样式 */
        input[type="submit"] {
            background-color: #007bff;
            color: white;
            padding: 10px 20px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            width: 100%;
            transition: background-color 0.3s ease;
        }

        input[type="submit"]:hover {
            background-color: #0056b3;
        }
    </style>
</head>

<body>
<h1>添加学生</h1>
<table border="1">
    <tr>
        <th>编号</th>
        <th>姓名</th>
        <th>性别</th>
        <th>生日</th>
        <th>班级</th>
        <th>操作</th>
        <th>编辑</th>
    </tr>
    <c:forEach items="${students}" var="stu">
        <tr>
            <td>${stu.id}</td>
            <td>${stu.name}</td>
            <td>${stu.gender}</td>
            <td>${stu.birthday}</td>
            <td>${stu.clazz}</td>
            <td><a href="StudentServlet?id=${stu.id}">删除</a></td>
            <td><a href="StudentServlet?id=${stu.id}">编辑</a></td>
        </tr>
    </c:forEach>


    <!-- 以下是示例数据行，实际中可根据从后端获取的数据动态生成 -->

</table>

<form action="StudentServlet" method="post">
    <!-- 姓名输入框 -->
    <label for="name">姓名：</label>
    <input type="text" id="name" name="name" required />

    <!-- 性别单选按钮 -->
    <label for="gender">性别：</label>
    <div id="gender" class="radio-group">
        <input type="radio" id="male" name="gender" value="男" checked />
        <label for="male">男</label>
        <input type="radio" id="female" name="gender" value="女" />
        <label for="female">女</label>
    </div>

    <!-- 生日日期输入框 -->
    <label for="birthday">生日：</label>
    <input type="date" id="birthday" name="birthday" required />

    <!-- 班级输入框 -->
    <label for="clazz">班级：</label>
    <input type="text" id="clazz" name="clazz" required />

    <!-- 提交按钮 -->
    <input type="submit" value="添加学生" />
</form>
</body>

</html>